
Imports System
Imports System.Data.SqlClient
Imports _2bMatesSite.Common


Namespace _2bMatesSite.BO
	''' <summary>
	''' Represents a simple read-only web page template (name/picture path/css styles path).
	''' </summary>
	Public Class Template
		Protected id As Integer = -1
		Protected name As String = Nothing
		Protected picture As String = Nothing
		Protected cssfile As String = Nothing

		Public Sub New(ByVal dr As SqlDataReader)
			Load(dr)
		End Sub


		Public ReadOnly Property ID() As Integer
			Get
				Return id
			End Get
		End Property

		Public ReadOnly Property Name() As String
			Get
				Return name
			End Get
		End Property

		Public ReadOnly Property TemplatePicture() As String
			Get
				Return picture
			End Get
		End Property

		Public ReadOnly Property CSSFileName() As String
			Get
				Return cssfile
			End Get
		End Property


		'
		' Private and protected members
		'

		Protected Sub Load(ByVal dr As SqlDataReader)
			id = DBManager.GetNZInt32(dr, "ID")
			name = DBManager.GetNZString(dr, "Name")
			picture = DBManager.GetNZString(dr, "TemplatePicture")
			cssfile = DBManager.GetNZString(dr, "CSSFileName")
		End Sub
	End Class
End Namespace






